<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			.active {
				color: red;
			}
		</style>
	</head>

	<body>
		<div id="app">
			<h2 class="pink" :class="{active:isActive,lint:isLint}">
				{{message}}
			</h2>
			<h3 class="pink" :class="getClass()">
				{{message}}
			</h3>
			<button v-on:click="btnClick">按钮</button>
		</div>

		<script src="../lib/vue.js"></script>
		<script>
			let vm = new Vue({
				el: "#app",
				data: {
					message: "你好啊",
					isActive: true,
					isLint: true
				},
				methods: {
					btnClick() {
						this.isActive = !this.isActive;
					},
					getClass() {
						return { active: this.isActive, lint: this.isLint };
					}
				}
			});
		</script>
	</body>
</html>
